package com.gzx.plugin.data.wxjk.controller;

import java.util.List;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.gzx.plugin.data.wxjk.entity.DataWxjkDdzwxx;
import com.gzx.plugin.data.wxjk.service.IDataWxjkDdzwxxService;

import cn.hutool.core.collection.CollUtil;

/**
 * @author xbl
 */
@RestController
@RequestMapping("/feign/data")
public class GzxWxjkDdzwxxController {

    private final IDataWxjkDdzwxxService ddzwxxService;

    public GzxWxjkDdzwxxController(IDataWxjkDdzwxxService ddzwxxService) {
        this.ddzwxxService = ddzwxxService;
    }

    //获取客户信息
    @RequestMapping("/getCustom")
    public String voiceToText(@RequestBody List<String> list) {
        List<DataWxjkDdzwxx> custom = ddzwxxService.getCustom(list);
        if (CollUtil.isNotEmpty(custom)) {
            return JSON.toJSONString(custom);
        } else {
            return "[]";
        }
    }
	// 获取客户信息
	@PostMapping("/getCustomByDate")
	public String getCustom(@RequestParam("start") String start, @RequestParam("end") String end,
			@RequestBody List<String> ids) {
		List<DataWxjkDdzwxx> custom = ddzwxxService.getCustomByDate(start, end, ids);
		if (CollUtil.isNotEmpty(custom)) {
			return JSON.toJSONString(custom);
		} else {
			return "[]";
		}
	}

}
